Solving 10385 - Duathlon (Ternary search)
[andmenj-acm.git] / 320 - Border / 320.c
bloba218fe2012dc9df00477a48189e53325f81e7f63
1 #include <stdio.h>
2 #include <string.h>
3 char m[32][32], d, x = 'X';
4 int main(){
5 int t=1, c, i, j;
6 for (scanf("%d", &c); c-- && scanf("%d %d\n", &j, &i) == 2 && printf("Bitmap #%d\n", t++); printf("\n")){
7 memset(m, '.', sizeof m);
8 while (scanf("%c", &c) && c != '.'){
9 if (c == 'E') m[i-1][j++] = x;
10 else if (c == 'W') m[i][(j--)-1] = x;
11 else if (c == 'S') m[(i--)-1][j-1] = x;
12 else if (c == 'N') m[i++][j] = x;
14 for (i=31; i>=0; --i, printf("\n"))
15 for (j=0; j<32; printf("%c", m[i][j++]));
17 return 0;